package field_REGEX_Definitions;

import java.util.regex.Matcher;
import java.util.regex.Pattern;

import fields.*;

public class DefaultMatcher implements Field {
	private Pattern defPattern = Pattern.compile("(.+)",Pattern.CASE_INSENSITIVE);
	private String field;
	private String type = "default";
	
	@Override
	public boolean matches(String input) {
		Matcher matcher = defPattern.matcher(input);
		boolean result = matcher.find();
		if (result) {
			field = matcher.group(1);
		}
		return result;
	}
	
	@Override
	public String getFieldName() {
		return field;
	}

	@Override
	public Default execute() {
		return new Default(field,"Other");
	}

	@Override
	public String getFieldType() {
		return type;
	}

}
